<template>
  <div class="app-container">
    <common-custom-group-list v-if="isAdmin"/>
    <el-tabs v-else v-model="activeName" stretch @tab-click="handleClick">
      <el-tab-pane label="自定义组" name="first">
        <personal-custom-group-list/>
      </el-tab-pane>
      <el-tab-pane label="全局组" name="second">
        <common-custom-group-list :is-admin="isAdmin"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import PersonalCustomGroupList from './personalCustomGroupList'
import CommonCustomGroupList from './commonCustomGroupList'
import { mapGetters } from 'vuex'

export default {
  name: 'CustomGroupList',
  components: { PersonalCustomGroupList, CommonCustomGroupList },
  data() {
    return {
      activeName: 'second',
      roles: null
    }
  },
  computed: {
    ...mapGetters(['isAdmin'])
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event)
    }
  }
}
</script>

<style scoped>

</style>
